﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightApplication1.DataTypes
{
    public class DTSearchCriteria
    {
        #region CONSTANTS
        public const int NOTHING = 0;
        //SORT BY
        public const int LST_PRICE_ASC = 1;
        public const int LST_PRICE_DSC = 2;
        public const int PUB_DATE = 3;
        public const int TITLE = 4;
        //CONDITION
        public const string COND_NEW = "New";
        public const string COND_USED = "Used";
        public const string COND_COLLECTIBLE = "Collectible";
        public const string COND_REFURBISHED = "Refurbished";
        public const string COND_All = "All";                
        #endregion

        #region FIELDS
        public bool isAdvanced { get; set; }
        public string mainKeywords { get; set; }
        public SortCondition sortBy { get; set; }
        public string author { get; set; }
        public string publisher { get; set; }
        public string title { get; set; }
        public int category { get; set; }
        public string condition { get; set; }
        public string keywords { get; set; }
        public int maxPrice { get; set; }
        public int minPrice { get; set; }
        #endregion

        public DTSearchCriteria()
        {
            sortBy = new SortCondition(false);
            author = "";
            publisher = "";
            title = "";
            category = NOTHING;
            condition = DTSearchCriteria.COND_NEW;
            keywords = "";
            maxPrice = 0;
            minPrice = 0;
        }
    }

    public class SortCondition
    {
        public bool isSortConditionSelected { get; set; }
        public bool isSecondConditionSelected { get; set; }
        public bool isThirdConditionSelected { get; set; }

        public int firstSortCondition { get; set; }
        public int secondSortCondition { get; set; }
        public int thirdSortCondition { get; set; }

        public SortCondition(bool isSortSelected)
        {
            this.isSortConditionSelected = isSortSelected;
        }
    }
}
